package com.numbfish.ch01_ex01_bean_resister.config;


import com.numbfish.ch01_ex01_bean_resister.pojo.Person;
import org.springframework.context.annotation.*;

@Configuration
public class CustomConfig02Scope {
    /**
     * scope 取值
     *
     *ConfigurableBeanFactory. SCOPE_PROTOTYPE, 多实例
     *ConfigurableBeanFactory. SCOPE_SINGLETON, 默认单例
     *org. springframework. web. context. WebApplicationContext. SCOPE_REQUEST, 同一次请求创建一次
     *org. springframework. web. context. WebApplicationContext. SCOPE_SESSION, 同一个session创建一次
     */
    @Scope("prototype")
    @Bean("person")
    public Person person(){
        return new Person("曹操",44);
    }
}
